angular.module('Controller')
.directive('pcFloatingToolbar',[()->
    return {
        restrict:'E'
        replace:true
        templateUrl:'templates/directive/pc-floating-toolbar/pc-floating-toolbar.html'
        controller:'pcFloatingToolbarCtrl'
    }
])

.controller 'pcFloatingToolbarCtrl',($scope,$localStorage)->
    $scope.backTop=()->
        $('html, body').animate({
            scrollTop: $("#header").offset().top
        }, 500);
        ''
    $scope.clickFtbPhone=()->
        phoneHidden=$('.pc-floating-toolbar .phone-hidden').eq(0)
        if phoneHidden.css('width')=='0' || phoneHidden.css('width')=='0px'
            phoneHidden.css('width','240px')
#            _.delay(()->
#                if phoneHidden.css('width')=='220px'
#                    phoneHidden.css('width','0')
#                    ''
#            ,4500)
        ''
    $scope.leaveFtbPhone=()->
        phoneHidden=$('.pc-floating-toolbar .phone-hidden').eq(0)
        _.delay(()->
            if phoneHidden.css('width')=='240px'
                phoneHidden.css('width','0')
        ,4500)
        ''




